// useRef 获取Dom
import React from "react";
import { useRef } from "react";

function App () {
  const refInput = useRef();
  const AddNum = () => {
    refInput.current.value = "123";
  }
  return(
    <div>
      <input ref={refInput} />
      <button onClick={AddNum}>
        Click me
      </button>
    </div>
  )
}
export default App;